<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>YuTori Class: test/system.php ソースファイル</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 作成： Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "../../search",false,'検索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">YuTori Class</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>メインページ</span></a></li>
      <li><a href="../../pages.html"><span>関連ページ</span></a></li>
      <li><a href="../../annotated.html"><span>データ構造</span></a></li>
      <li class="current"><a href="../../files.html"><span>ファイル</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="検索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>ファイル一覧</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">test/system.php</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a>00002 <span class="comment">// テスト用クラス</span>
<a name="l00003"></a><a class="code" href="../../d7/d1e/classmy_cls.html">00003</a> <span class="keyword">class </span><a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a> {
<a name="l00004"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a9b66974a2407eb7e46367aa28f9be7eb">00004</a>         <span class="keyword">public</span> <a class="code" href="../../d7/d1e/classmy_cls.html#a9b66974a2407eb7e46367aa28f9be7eb">$beforeGet</a> = <span class="keyword">false</span>;
<a name="l00005"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a97d9bd1c25715edd5cd2b45537c7ea1d">00005</a>         <span class="keyword">public</span> <a class="code" href="../../d7/d1e/classmy_cls.html#a97d9bd1c25715edd5cd2b45537c7ea1d">$afterGet</a> = <span class="keyword">false</span>;
<a name="l00006"></a><a class="code" href="../../d7/d1e/classmy_cls.html#acf38bc5710fd58fb88730505c2ffec65">00006</a>         <span class="keyword">public</span> <a class="code" href="../../d7/d1e/classmy_cls.html#acf38bc5710fd58fb88730505c2ffec65">$beforeSet</a> = <span class="keyword">false</span>;
<a name="l00007"></a><a class="code" href="../../d7/d1e/classmy_cls.html#ad5564e84d758fef5e0fc82745d091096">00007</a>         <span class="keyword">public</span> <a class="code" href="../../d7/d1e/classmy_cls.html#ad5564e84d758fef5e0fc82745d091096">$afterSet</a> = <span class="keyword">false</span>;
<a name="l00008"></a><a class="code" href="../../d7/d1e/classmy_cls.html#af1de86bf6bf9d628975ea8060540f234">00008</a>         <span class="keyword">public</span> <a class="code" href="../../d7/d1e/classmy_cls.html#af1de86bf6bf9d628975ea8060540f234">$callRes</a> = null;
<a name="l00009"></a>00009         
<a name="l00010"></a><a class="code" href="../../d7/d1e/classmy_cls.html#ad4b402b4e915ffc6edfefeb2b1186361">00010</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#ad4b402b4e915ffc6edfefeb2b1186361">flgReset</a> () {
<a name="l00011"></a>00011                 $this-&gt;beforeGet = <span class="keyword">false</span>;
<a name="l00012"></a>00012                 $this-&gt;afterGet = <span class="keyword">false</span>;
<a name="l00013"></a>00013                 $this-&gt;beforeSet = <span class="keyword">false</span>;
<a name="l00014"></a>00014                 $this-&gt;afterSet = <span class="keyword">false</span>;
<a name="l00015"></a>00015         }
<a name="l00016"></a>00016         
<a name="l00017"></a><a class="code" href="../../d7/d1e/classmy_cls.html#ac5dc87eed2e2b04cabb082628063159d">00017</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#ac5dc87eed2e2b04cabb082628063159d">_beforeGet</a> () {
<a name="l00018"></a>00018                 $this-&gt;beforeGet = <span class="keyword">true</span>;
<a name="l00019"></a>00019                 
<a name="l00020"></a>00020         }
<a name="l00021"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a2bafc7097418250117a122088f5d3a59">00021</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#a2bafc7097418250117a122088f5d3a59">_afterGet</a> () {
<a name="l00022"></a>00022                 $this-&gt;afterGet = <span class="keyword">true</span>;
<a name="l00023"></a>00023         }
<a name="l00024"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a7ecd6d8233744922bb6a7b3a0c287364">00024</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#a7ecd6d8233744922bb6a7b3a0c287364">_beforeSet</a> () {
<a name="l00025"></a>00025                 $this-&gt;beforeSet = <span class="keyword">true</span>;
<a name="l00026"></a>00026         }
<a name="l00027"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a0fcd6e51ddf5624faec93af2a1dd62ad">00027</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#a0fcd6e51ddf5624faec93af2a1dd62ad">_afterSet</a> () {
<a name="l00028"></a>00028                 $this-&gt;afterSet = <span class="keyword">true</span>;
<a name="l00029"></a>00029         }
<a name="l00030"></a>00030         
<a name="l00031"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a87caa8ea30d04a62308b23884d217c8d">00031</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#a87caa8ea30d04a62308b23884d217c8d">myMethod</a> () {
<a name="l00032"></a>00032                 <span class="keywordflow">return</span> <span class="stringliteral">&#39;method!&#39;</span>;
<a name="l00033"></a>00033         }
<a name="l00034"></a>00034         
<a name="l00035"></a><a class="code" href="../../d7/d1e/classmy_cls.html#a3121092022b7210e467735c37c5d3158">00035</a>         function <a class="code" href="../../d7/d1e/classmy_cls.html#a3121092022b7210e467735c37c5d3158">call</a> ($str = null) {
<a name="l00036"></a>00036                 <span class="keywordflow">if</span> ($str) $this-&gt;callRes = $str;
<a name="l00037"></a>00037                 <span class="keywordflow">return</span> <span class="stringliteral">&#39;call!&#39;</span>;
<a name="l00038"></a>00038         }
<a name="l00039"></a>00039         
<a name="l00040"></a>00040 }
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="comment">// テスト用関数</span>
<a name="l00043"></a>00043 function myFunc ($arg = null) {
<a name="l00044"></a>00044         <span class="keywordflow">if</span> ($arg) <span class="keywordflow">return</span> $arg;
<a name="l00045"></a>00045         <span class="keywordflow">return</span> <span class="stringliteral">&#39;func!&#39;</span>;
<a name="l00046"></a>00046 }
<a name="l00047"></a>00047 <span class="comment">// factoryおよび型関係のテスト</span>
<a name="l00048"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html">00048</a> <span class="keyword">class </span><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html">TestofYuToriFactory</a> <span class="keyword">extends</span> UnitTestCase {
<a name="l00049"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a095c5d389db211932136b53f25f39685">00049</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a095c5d389db211932136b53f25f39685">__construct</a> () {
<a name="l00050"></a>00050                 $this-&gt;arrObj = array(
<a name="l00051"></a>00051                         <span class="stringliteral">&#39;Null&#39;</span>=&gt;null,
<a name="l00052"></a>00052                         <span class="stringliteral">&#39;Scalar&#39;</span>=&gt;<span class="stringliteral">&#39;Hello World!&#39;</span>,
<a name="l00053"></a>00053                         <span class="stringliteral">&#39;Array&#39;</span>=&gt;array(<span class="charliteral">&#39;a&#39;</span>, <span class="charliteral">&#39;b&#39;</span>, <span class="charliteral">&#39;c&#39;</span>),
<a name="l00054"></a>00054                         <span class="stringliteral">&#39;Object&#39;</span>=&gt;<span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>(),
<a name="l00055"></a>00055                         <span class="stringliteral">&#39;Bool&#39;</span>=&gt;<span class="keyword">true</span>,
<a name="l00056"></a>00056                 );
<a name="l00057"></a>00057                 
<a name="l00058"></a>00058                 <span class="comment">// 試験を書き直すのが面倒なので、Rootオブジェクト代わりを作成しておく。</span>
<a name="l00059"></a>00059                 $this-&gt;obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, null);
<a name="l00060"></a>00060         }
<a name="l00061"></a>00061         
<a name="l00062"></a>00062         <span class="comment">// factoryメソッドとgetTypeの動作確認。</span>
<a name="l00063"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a32d43156d9155b55c31155ca6ac4162e">00063</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a32d43156d9155b55c31155ca6ac4162e">TestofFactory</a>() {
<a name="l00064"></a>00064                 <span class="comment">// type = auto</span>
<a name="l00065"></a>00065                 <span class="keywordflow">foreach</span> ($this-&gt;arrObj as $Key=&gt;$Val) {
<a name="l00066"></a>00066                         $type = constant(<span class="stringliteral">&#39;YuTori::TYPE_&#39;</span>.strtoupper($Key));
<a name="l00067"></a>00067                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($Key, $Val);
<a name="l00068"></a>00068                         $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;factoryがセレクタを返していません。&#39;</span>);
<a name="l00069"></a>00069                         $this-&gt;assertIdentical($obj-&gt;getType(), $type, <span class="stringliteral">&#39;factoryが&#39;</span>.$Key.<span class="stringliteral">&#39;型を作成していません。&#39;</span>.$obj-&gt;getType());
<a name="l00070"></a>00070                 }
<a name="l00071"></a>00071 
<a name="l00072"></a>00072                 <span class="comment">// type指定</span>
<a name="l00073"></a>00073                 <span class="keywordflow">foreach</span> ($this-&gt;arrObj as $Key=&gt;$Val) {
<a name="l00074"></a>00074                         $type = constant(<span class="stringliteral">&#39;YuTori::TYPE_&#39;</span>.strtoupper($Key));
<a name="l00075"></a>00075                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($Key, $Val, $type);
<a name="l00076"></a>00076                         $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;型指定時、factoryがセレクタを返していません。&#39;</span>);
<a name="l00077"></a>00077                         $this-&gt;assertIdentical($obj-&gt;getType(), constant(<span class="stringliteral">&#39;YuTori::TYPE_&#39;</span>.strtoupper($Key)), <span class="stringliteral">&#39;型指定時、factoryが&#39;</span>.$Key.<span class="stringliteral">&#39;型を作成していません。&#39;</span>);
<a name="l00078"></a>00078                 }
<a name="l00079"></a>00079 
<a name="l00080"></a>00080                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;Function&#39;</span>, Y::Func(<span class="stringliteral">&#39;myFunc&#39;</span>));
<a name="l00081"></a>00081                 $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;型指定時、factoryがセレクタを返していません。&#39;</span>);
<a name="l00082"></a>00082                 $this-&gt;assertIdentical($obj-&gt;getType(), <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>, <span class="stringliteral">&#39;型指定時、factoryがfunction型を作成していません。&#39;</span>);
<a name="l00083"></a>00083 
<a name="l00084"></a>00084                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;Function&#39;</span>, array(<span class="keyword">new</span> MyCls(), <span class="stringliteral">&#39;myMethod&#39;</span>), <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>);
<a name="l00085"></a>00085                 $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;型指定時、メソッドを渡されたfactoryがセレクタを返していません。&#39;</span>);
<a name="l00086"></a>00086                 $this-&gt;assertIdentical($obj-&gt;getType(), <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>, <span class="stringliteral">&#39;型指定時、メソッドを渡されたfactoryがfunction型を作成していません。&#39;</span>);
<a name="l00087"></a>00087 
<a name="l00088"></a>00088                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>, <a class="code" href="../../d0/dfd/class_yu_tori.html#a3f11f6ed0d9e135ce0fd44b214bc20d5">YuTori::TYPE_EMPTY</a>);
<a name="l00089"></a>00089                 $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;型指定時、factoryがセレクタを返していません。&#39;</span>);
<a name="l00090"></a>00090                 $this-&gt;assertIdentical($obj-&gt;getType(), <a class="code" href="../../d0/dfd/class_yu_tori.html#a3f11f6ed0d9e135ce0fd44b214bc20d5">YuTori::TYPE_EMPTY</a>, <span class="stringliteral">&#39;型指定時、factoryがempty型を作成していません。&#39;</span>);
<a name="l00091"></a>00091 
<a name="l00092"></a>00092                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;abcdefg&#39;</span>);
<a name="l00093"></a>00093                 $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;存在しない型指定時、factoryがセレクタを返していません。&#39;</span>);
<a name="l00094"></a>00094                 $this-&gt;assertIdentical($obj-&gt;getType(), <a class="code" href="../../d0/dfd/class_yu_tori.html#a3f11f6ed0d9e135ce0fd44b214bc20d5">YuTori::TYPE_EMPTY</a>, <span class="stringliteral">&#39;存在しない型指定時、factoryがempty型を作成していません。&#39;</span>);
<a name="l00095"></a>00095 
<a name="l00096"></a>00096                 <span class="comment">// YuToriを指定</span>
<a name="l00097"></a>00097                 <span class="keywordflow">foreach</span> ($this-&gt;arrObj as $Key=&gt;$Val) {
<a name="l00098"></a>00098                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($Key, $Val, $Key);
<a name="l00099"></a>00099                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, $obj);
<a name="l00100"></a>00100                         $this-&gt;assertIdentical(get_class($obj), <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;factoryに&#39;</span>.$Key.<span class="stringliteral">&#39;型YuToriを渡した時、セレクタを返していません。&#39;</span>);
<a name="l00101"></a>00101                         $this-&gt;assertIdentical($obj-&gt;getType(), constant(<span class="stringliteral">&#39;YuTori::TYPE_&#39;</span>.strtoupper($Key)), <span class="stringliteral">&#39;factoryに&#39;</span>.$Key.<span class="stringliteral">&#39;型YuToriを渡した時、&#39;</span>.$Key.<span class="stringliteral">&#39;型を作成していません。&#39;</span>);
<a name="l00102"></a>00102                 }
<a name="l00103"></a>00103         }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105         <span class="comment">// getName、setNameの動作確認</span>
<a name="l00106"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a166109fc2607340029561cc5736c9eb5">00106</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a166109fc2607340029561cc5736c9eb5">TestofName</a>() {
<a name="l00107"></a>00107                 <span class="keywordflow">foreach</span> ($this-&gt;arrObj as $Key=&gt;$Val) {
<a name="l00108"></a>00108                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($Key, $Val);
<a name="l00109"></a>00109                         $this-&gt;assertIdentical($obj-&gt;getName(), $Key, <span class="stringliteral">&#39;YuToriが名称&#39;</span>.$Key.<span class="stringliteral">&#39;を保持していません。&#39;</span>);
<a name="l00110"></a>00110                         $obj-&gt;setName (<span class="stringliteral">&#39;newName&#39;</span>);
<a name="l00111"></a>00111                         $this-&gt;assertIdentical($obj-&gt;getName(), <span class="stringliteral">&#39;newName&#39;</span>, <span class="stringliteral">&#39;YuTori::setNameで名称&#39;</span>.$Key.<span class="stringliteral">&#39;が変更されませんでした。&#39;</span>);
<a name="l00112"></a>00112                         $obj-&gt;setName (null);
<a name="l00113"></a>00113                         $this-&gt;assertIdentical($obj-&gt;getName(), <span class="stringliteral">&#39;newName&#39;</span>, <span class="stringliteral">&#39;YuTori::setNameにnull指定時、名称&#39;</span>.$Key.<span class="stringliteral">&#39;が変更されました。&#39;</span>);
<a name="l00114"></a>00114                 }
<a name="l00115"></a>00115         }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117         <span class="comment">// get、setの動作確認</span>
<a name="l00118"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a05a8a3b5812cb7362f9ffc818593a479">00118</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a05a8a3b5812cb7362f9ffc818593a479">TestofInstance</a>() {
<a name="l00119"></a>00119                 $arrSub = $this-&gt;arrObj;
<a name="l00120"></a>00120                 <span class="comment">// 基本パターンは全て組み合わせる</span>
<a name="l00121"></a>00121                 <span class="keywordflow">foreach</span> ($arrSub as $srcKey=&gt;$srcVal) {
<a name="l00122"></a>00122                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($srcKey, $srcVal);
<a name="l00123"></a>00123                         <span class="keywordflow">foreach</span> ($this-&gt;arrObj as $dstKey=&gt;$dstVal) {
<a name="l00124"></a>00124                                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($srcKey, $srcVal);
<a name="l00125"></a>00125                                 $this-&gt;assertTrue($obj-&gt;set ($dstVal) ===       $obj, $srcKey.<span class="stringliteral">&#39;型に&#39;</span>.$dstKey.<span class="stringliteral">&#39;型をsetした際の戻り値が自分自身ではありません。&#39;</span>);
<a name="l00126"></a>00126                                 $this-&gt;assertIdentical($obj-&gt;get(), $dstVal, $srcKey.<span class="stringliteral">&#39;型に&#39;</span>.$dstKey.<span class="stringliteral">&#39;型をsetした際の保持インスタンスが間違っています。&#39;</span>);
<a name="l00127"></a>00127                         }
<a name="l00128"></a>00128                 }
<a name="l00129"></a>00129         }
<a name="l00130"></a>00130 
<a name="l00131"></a>00131         <span class="comment">// addの動作確認。addParentsも内包される。children、parentsの基礎も。</span>
<a name="l00132"></a>00132         <span class="comment">// ToDo: ここにcountの試験も追加する。</span>
<a name="l00133"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#aac26940c8db6bd209d79b8d3e2c5f955">00133</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#aac26940c8db6bd209d79b8d3e2c5f955">TestofAdd</a>() {
<a name="l00134"></a>00134                 $child = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;null&#39;</span>, null);
<a name="l00135"></a>00135                 $this-&gt;assertIdentical($child-&gt;get(), null, <span class="stringliteral">&#39;addにnull指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00136"></a>00136                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;null&#39;</span>, <span class="stringliteral">&#39;addにnull指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00137"></a>00137                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;null&#39;</span>)-&gt;pick() === $child-&gt;pick(), <span class="stringliteral">&#39;addにnull指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00138"></a>00138                 
<a name="l00139"></a>00139                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addにnull指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00140"></a>00140                 
<a name="l00141"></a>00141                 $child = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;scalar&#39;</span>, <span class="stringliteral">&#39;abc&#39;</span>);
<a name="l00142"></a>00142                 $this-&gt;assertIdentical($child-&gt;get(), <span class="stringliteral">&#39;abc&#39;</span>, <span class="stringliteral">&#39;addに&quot;abc&quot;指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00143"></a>00143                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;scalar&#39;</span>, <span class="stringliteral">&#39;addに&quot;abc&quot;指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00144"></a>00144                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;scalar&#39;</span>)-&gt;pick() === $child-&gt;pick(), <span class="stringliteral">&#39;addに&quot;abc&quot;指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00145"></a>00145                 
<a name="l00146"></a>00146                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addに&quot;abc&quot;指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00147"></a>00147                 
<a name="l00148"></a>00148                 <span class="comment">// 同名上書き</span>
<a name="l00149"></a>00149                 $child = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;scalar&#39;</span>, 123);
<a name="l00150"></a>00150                 $this-&gt;assertIdentical($child-&gt;get(), 123, <span class="stringliteral">&#39;addに123指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00151"></a>00151                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;scalar&#39;</span>, <span class="stringliteral">&#39;addに123指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00152"></a>00152                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;scalar&#39;</span>)-&gt;pick() === $child-&gt;pick(), <span class="stringliteral">&#39;addに123指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00153"></a>00153                 
<a name="l00154"></a>00154                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addに123指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00155"></a>00155                 
<a name="l00156"></a>00156                 $child = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;array&#39;</span>, array(<span class="charliteral">&#39;a&#39;</span>,<span class="charliteral">&#39;b&#39;</span>));
<a name="l00157"></a>00157                 $this-&gt;assertTrue(is_array($child-&gt;get()), <span class="stringliteral">&#39;addに配列指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00158"></a>00158                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;array&#39;</span>, <span class="stringliteral">&#39;addに配列指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00159"></a>00159                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;array&#39;</span>)-&gt;pick() === $child-&gt;pick(), <span class="stringliteral">&#39;addに配列指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00160"></a>00160                 
<a name="l00161"></a>00161                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() ===
<a name="l00162"></a>00162                         $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addに配列指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00163"></a>00163                 
<a name="l00164"></a>00164                 $child = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;object&#39;</span>, $obj = <span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a> ());
<a name="l00165"></a>00165                 $this-&gt;assertIdentical($child-&gt;get(), $obj,
<a name="l00166"></a>00166                 <span class="stringliteral">&#39;addにオブジェクト指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00167"></a>00167                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;object&#39;</span>,
<a name="l00168"></a>00168                 <span class="stringliteral">&#39;addにオブジェクト指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00169"></a>00169                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;object&#39;</span>)-&gt;pick()
<a name="l00170"></a>00170                         === $child-&gt;pick(), <span class="stringliteral">&#39;addにオブジェクト指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00171"></a>00171                 
<a name="l00172"></a>00172                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() ===
<a name="l00173"></a>00173                         $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addにオブジェクト指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00174"></a>00174                 
<a name="l00175"></a>00175                 $child = $this-&gt;obj-&gt;add
<a name="l00176"></a>00176                         (<span class="stringliteral">&#39;function&#39;</span>,<a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;myFunc&#39;</span>, <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>));
<a name="l00177"></a>00177                 $this-&gt;assertIdentical($child-&gt;get(), <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>, <span class="stringliteral">&#39;addに関数指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00178"></a>00178                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;function&#39;</span>, <span class="stringliteral">&#39;addに関数指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00179"></a>00179                 
<a name="l00180"></a>00180                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;function&#39;</span>)-&gt;pick() === $child-&gt;pick(), <span class="stringliteral">&#39;addに関数指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00181"></a>00181                 
<a name="l00182"></a>00182                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addに関数指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00183"></a>00183                 
<a name="l00184"></a>00184                 $child = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;function&#39;</span>,<a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, array(<span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>(),
<a name="l00185"></a>00185                         <span class="stringliteral">&#39;myMethod&#39;</span>), <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>) );
<a name="l00186"></a>00186                 $this-&gt;assertIdentical($child-&gt;get(), <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>, <span class="stringliteral">&#39;addにメソッド指定時、戻り値のgetの値が間違っています。&#39;</span>);
<a name="l00187"></a>00187                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;function&#39;</span>, <span class="stringliteral">&#39;addにメソッド指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00188"></a>00188                 
<a name="l00189"></a>00189                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;function&#39;</span>)-&gt;pick() === $child-&gt;pick(), <span class="stringliteral">&#39;addにメソッド指定時、childの戻り値とaddの戻り値が違います。&#39;</span>);
<a name="l00190"></a>00190                 
<a name="l00191"></a>00191                 $this-&gt;assertTrue($child-&gt;parent($this-&gt;obj-&gt;getName())-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;addにメソッド指定時、戻り値のparentが自分自身ではありません。&#39;</span>);
<a name="l00192"></a>00192         }
<a name="l00193"></a>00193         
<a name="l00194"></a>00194         <span class="comment">// removeの動作確認。removeParentsも内包される。children、parentsの基礎も。</span>
<a name="l00195"></a>00195         <span class="comment">// ついでに軽くisEmptyも。</span>
<a name="l00196"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a447c9f52b307fd1d315496a2c20ff165">00196</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a447c9f52b307fd1d315496a2c20ff165">TestofRemove</a>() {
<a name="l00197"></a>00197                 $child = $this-&gt;obj-&gt;remove (<span class="stringliteral">&#39;null&#39;</span>);
<a name="l00198"></a>00198                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;removeにnull指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00199"></a>00199                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;null&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;removeにnull指定時、childの戻り値がfalseではありません。&#39;</span>);
<a name="l00200"></a>00200                 
<a name="l00201"></a>00201                 $child = $this-&gt;obj-&gt;remove (<span class="stringliteral">&#39;scalar&#39;</span>);
<a name="l00202"></a>00202                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;removeに&quot;abc&quot;指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00203"></a>00203                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;scalar&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;removeに&quot;abc&quot;指定時、childの戻り値とremoveの戻り値が違います。&#39;</span>);
<a name="l00204"></a>00204                 
<a name="l00205"></a>00205                 $child = $this-&gt;obj-&gt;remove (<span class="stringliteral">&#39;array&#39;</span>);
<a name="l00206"></a>00206                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;removeに配列指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00207"></a>00207                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;array&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;removeに配列指定時、childの戻り値とremoveの戻り値が違います。&#39;</span>);
<a name="l00208"></a>00208                 
<a name="l00209"></a>00209                 $child = $this-&gt;obj-&gt;remove (<span class="stringliteral">&#39;object&#39;</span>);
<a name="l00210"></a>00210                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;removeにオブジェクト指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00211"></a>00211                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;object&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;removeにオブジェクト指定時、childの戻り値とremoveの戻り値が違います。&#39;</span>);
<a name="l00212"></a>00212                 
<a name="l00213"></a>00213                 $child = $this-&gt;obj-&gt;remove (<span class="stringliteral">&#39;function&#39;</span>);
<a name="l00214"></a>00214                 $this-&gt;assertIdentical($child-&gt;getName(), <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;removeに関数指定時、戻り値のgetNameの値が間違っています。&#39;</span>);
<a name="l00215"></a>00215                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;function&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;removeに関数指定時、childの戻り値とremoveの戻り値が違います。&#39;</span>);
<a name="l00216"></a>00216         }
<a name="l00217"></a>00217         
<a name="l00218"></a>00218         <span class="comment">// childの動作確認。</span>
<a name="l00219"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#ac745cdeeaef1f219759fda3115213bb6">00219</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#ac745cdeeaef1f219759fda3115213bb6">TestofChild</a>() {
<a name="l00220"></a>00220                 <span class="comment">// 形を作っておく。値は区別がつく程度に適当。</span>
<a name="l00221"></a>00221                 $a = $this-&gt;obj-&gt;add (<span class="charliteral">&#39;a&#39;</span>, <span class="stringliteral">&#39;value_a&#39;</span>);
<a name="l00222"></a>00222                 $b = $a-&gt;add (<span class="charliteral">&#39;b&#39;</span>, <span class="stringliteral">&#39;value_b&#39;</span>);
<a name="l00223"></a>00223                 $c = $b-&gt;add (<span class="charliteral">&#39;c&#39;</span>, <span class="stringliteral">&#39;value_c&#39;</span>);
<a name="l00224"></a>00224                 $a2 = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;a2&#39;</span>, <span class="stringliteral">&#39;value_a2&#39;</span>);
<a name="l00225"></a>00225                 $b2 = $a2-&gt;add (<span class="stringliteral">&#39;b2&#39;</span>, <span class="stringliteral">&#39;value_b2&#39;</span>);
<a name="l00226"></a>00226                 $b22 = $a2-&gt;add (<span class="stringliteral">&#39;b22&#39;</span>, <span class="stringliteral">&#39;value_b22&#39;</span>);
<a name="l00227"></a>00227                 $c2 = $b2-&gt;add (<span class="stringliteral">&#39;c2&#39;</span>, <span class="stringliteral">&#39;value_c2&#39;</span>);
<a name="l00228"></a>00228                 $c22 = $b2-&gt;add (<span class="stringliteral">&#39;c22&#39;</span>, <span class="stringliteral">&#39;value_c22&#39;</span>);
<a name="l00229"></a>00229                 $a3 = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;a3&#39;</span>, <span class="stringliteral">&#39;value_a3&#39;</span>);
<a name="l00230"></a>00230                 $b3 = $a3-&gt;add (<span class="stringliteral">&#39;b3&#39;</span>, <span class="stringliteral">&#39;value_b3&#39;</span>);
<a name="l00231"></a>00231                 $c3 = $b3-&gt;add (<span class="stringliteral">&#39;c3&#39;</span>, <span class="stringliteral">&#39;value_c3&#39;</span>);
<a name="l00232"></a>00232                 
<a name="l00233"></a>00233                 <span class="comment">// 文字列セレクタのテスト</span>
<a name="l00234"></a>00234                 <span class="comment">// 1段階</span>
<a name="l00235"></a>00235                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="charliteral">&#39;a&#39;</span>)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;child文字列指定1段階(a)の戻り値が違います。&#39;</span>);
<a name="l00236"></a>00236                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39; a2 &#39;</span>)-&gt;pick() === $a2-&gt;pick(), <span class="stringliteral">&#39;child文字列指定1段階(a2)の戻り値が違います。&#39;</span>);
<a name="l00237"></a>00237                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a3.&#39;</span>)-&gt;pick() === $a3-&gt;pick(), <span class="stringliteral">&#39;child文字列指定1段階(a3)の戻り値が違います。&#39;</span>);
<a name="l00238"></a>00238                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a4&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定1段階(a4、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00239"></a>00239                 
<a name="l00240"></a>00240                 <span class="comment">// 2段階</span>
<a name="l00241"></a>00241                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a.b&#39;</span>)-&gt;pick() === $b-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a.b)の戻り値が違います。&#39;</span>);
<a name="l00242"></a>00242                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a2 . b2&#39;</span>)-&gt;pick() === $b2-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a2 . b2)の戻り値が違います。&#39;</span>);
<a name="l00243"></a>00243                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a3 . b3 .&#39;</span>)-&gt;pick() === $b3-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a3 . b3 .)の戻り値が違います。&#39;</span>);
<a name="l00244"></a>00244                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="charliteral">&#39;b&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定1段階(b、2段階目に存在している)の戻り値が違います。&#39;</span>);
<a name="l00245"></a>00245                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a.b2&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定2段階(a.b2、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00246"></a>00246                 
<a name="l00247"></a>00247                 <span class="comment">// 3段階</span>
<a name="l00248"></a>00248                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a.b.c&#39;</span>)-&gt;pick() === $c-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a.b.c)の戻り値が違います。&#39;</span>);
<a name="l00249"></a>00249                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a2 . b2 . c2&#39;</span>)-&gt;pick() === $c2-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a2 . b2 . c2)の戻り値が違います。&#39;</span>);
<a name="l00250"></a>00250                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a3 . b3 . c3 .&#39;</span>)-&gt;pick() === $c3-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a3 . b3 . c3        .)の戻り値が違います。&#39;</span>);
<a name="l00251"></a>00251                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;b.c&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定2段階(b.c、3段階目に存在している)の戻り値が違います。&#39;</span>);
<a name="l00252"></a>00252                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a.b.c2&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定3段階(a.b.c2、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00253"></a>00253                 
<a name="l00254"></a>00254                 <span class="comment">// 数値セレクタのテスト</span>
<a name="l00255"></a>00255                 <span class="comment">// 1段階</span>
<a name="l00256"></a>00256                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(0)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;child数値指定1段階(0)の戻り値が違います。&#39;</span>);
<a name="l00257"></a>00257                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(1)-&gt;pick() === $a2-&gt;pick(), <span class="stringliteral">&#39;child数値指定1段階(1)の戻り値が違います。&#39;</span>);
<a name="l00258"></a>00258                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(2)-&gt;pick() === $a3-&gt;pick(), <span class="stringliteral">&#39;child数値指定1段階(2)の戻り値が違います。&#39;</span>);
<a name="l00259"></a>00259                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(3)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定1段階(3、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00260"></a>00260                 
<a name="l00261"></a>00261                 <span class="comment">// 2段階</span>
<a name="l00262"></a>00262                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;0.0&#39;</span>)-&gt;pick() === $b-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(0.0)の戻り値が違います。&#39;</span>);
<a name="l00263"></a>00263                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;1.0&#39;</span>)-&gt;pick() === $b2-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(1.0)の戻り値が違います。&#39;</span>);
<a name="l00264"></a>00264                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;1.1.&#39;</span>)-&gt;pick() === $b22-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(1.1.)の戻り値が違います。&#39;</span>);
<a name="l00265"></a>00265                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;0.1&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定2段階(0.1、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00266"></a>00266                 
<a name="l00267"></a>00267                 <span class="comment">// 3段階</span>
<a name="l00268"></a>00268                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;0.0.0&#39;</span>)-&gt;pick() === $c-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(0.0.0)の戻り値が違います。&#39;</span>);
<a name="l00269"></a>00269                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;1.0.1&#39;</span>)-&gt;pick() === $c22-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(1.0.1)の戻り値が違います。&#39;</span>);
<a name="l00270"></a>00270                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;2.0.0.&#39;</span>)-&gt;pick() === $c3-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(2.0.0.)の戻り値が違います。&#39;</span>);
<a name="l00271"></a>00271                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;1.1.2&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定3段階(1.1.2、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00272"></a>00272                 
<a name="l00273"></a>00273                 <span class="comment">// 文字・数値混在</span>
<a name="l00274"></a>00274                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a2.1&#39;</span>)-&gt;pick() === $b22-&gt;pick(), <span class="stringliteral">&#39;child混在指定(a2.1)の戻り値が違います。&#39;</span>);
<a name="l00275"></a>00275                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a.0.&#39;</span>)-&gt;pick() === $b-&gt;pick(), <span class="stringliteral">&#39;child混在指定(a.0.)の戻り値が違います。&#39;</span>);
<a name="l00276"></a>00276                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;a.1&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定1段階(a.1、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00277"></a>00277                 
<a name="l00278"></a>00278                 <span class="comment">// オブジェクトセレクタのテスト</span>
<a name="l00279"></a>00279                 $this-&gt;assertTrue($this-&gt;obj-&gt;child($a)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;childオブジェクト指定($a)の戻り値が違います。&#39;</span>);
<a name="l00280"></a>00280                 $this-&gt;assertTrue($this-&gt;obj-&gt;child($b)-&gt;isEmpty(), <span class="stringliteral">&#39;childオブジェクト指定($b、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00281"></a>00281                 
<a name="l00282"></a>00282                 <span class="comment">// 戻り値の確認。</span>
<a name="l00283"></a>00283                 $this-&gt;assertTrue(get_class($this-&gt;obj-&gt;child(<span class="charliteral">&#39;a&#39;</span>)) === <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;childの戻り値がYuToriではありません。&#39;</span>);
<a name="l00284"></a>00284                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="charliteral">&#39;a&#39;</span>)-&gt;getType() === <span class="stringliteral">&#39;scalar&#39;</span>, <span class="stringliteral">&#39;childの戻り値のgetTypeが間違っています。&#39;</span>);
<a name="l00285"></a>00285         }
<a name="l00286"></a>00286         
<a name="l00287"></a>00287         <span class="comment">// parentの動作確認。</span>
<a name="l00288"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a1338be7e663342710efa11fad787767f">00288</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#a1338be7e663342710efa11fad787767f">TestofParent</a>() {
<a name="l00289"></a>00289                 <span class="comment">// 形を作っておく。値は区別がつく程度に適当。</span>
<a name="l00290"></a>00290                 $a = $this-&gt;obj-&gt;add (<span class="charliteral">&#39;a&#39;</span>, <span class="stringliteral">&#39;value_a&#39;</span>);
<a name="l00291"></a>00291                 $b = $a-&gt;add (<span class="charliteral">&#39;b&#39;</span>, <span class="stringliteral">&#39;value_b&#39;</span>);
<a name="l00292"></a>00292                 $c = $b-&gt;add (<span class="charliteral">&#39;c&#39;</span>, <span class="stringliteral">&#39;value_c&#39;</span>);
<a name="l00293"></a>00293                 $a2 = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;a2&#39;</span>, <span class="stringliteral">&#39;value_a2&#39;</span>);
<a name="l00294"></a>00294                 $b2 = $a2-&gt;add (<span class="stringliteral">&#39;b2&#39;</span>, <span class="stringliteral">&#39;value_b2&#39;</span>);
<a name="l00295"></a>00295                 $b22 = $a2-&gt;add (<span class="stringliteral">&#39;b22&#39;</span>, <span class="stringliteral">&#39;value_b22&#39;</span>);
<a name="l00296"></a>00296                 $c2 = $b2-&gt;add (<span class="stringliteral">&#39;c2&#39;</span>, <span class="stringliteral">&#39;value_c2&#39;</span>);
<a name="l00297"></a>00297                 $c22 = $b2-&gt;add (<span class="stringliteral">&#39;c22&#39;</span>, <span class="stringliteral">&#39;value_c22&#39;</span>);
<a name="l00298"></a>00298                 $a3 = $this-&gt;obj-&gt;add (<span class="stringliteral">&#39;a3&#39;</span>, <span class="stringliteral">&#39;value_a3&#39;</span>);
<a name="l00299"></a>00299                 $b3 = $a3-&gt;add (<span class="stringliteral">&#39;b3&#39;</span>, <span class="stringliteral">&#39;value_b3&#39;</span>);
<a name="l00300"></a>00300                 $c3 = $b3-&gt;add (<span class="stringliteral">&#39;c3&#39;</span>, <span class="stringliteral">&#39;value_c3&#39;</span>);
<a name="l00301"></a>00301                 
<a name="l00302"></a>00302                 <span class="comment">// 文字列セレクタのテスト</span>
<a name="l00303"></a>00303                 $this-&gt;assertTrue($a-&gt;parent(<span class="stringliteral">&#39;test&#39;</span>)-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;parent文字列指定1段階の戻り値が違います。&#39;</span>);
<a name="l00304"></a>00304                 $this-&gt;assertTrue($b-&gt;parent(<span class="stringliteral">&#39; a &#39;</span>)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;parent文字列指定2段階の戻り値が違います。&#39;</span>);
<a name="l00305"></a>00305                 $this-&gt;assertTrue($c-&gt;parent(<span class="stringliteral">&#39;a3&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;parent文字列指定、存在しない値の戻り値が違います。&#39;</span>);
<a name="l00306"></a>00306                 
<a name="l00307"></a>00307                 <span class="comment">// 数値セレクタのテスト</span>
<a name="l00308"></a>00308                 
<a name="l00309"></a>00309                 $this-&gt;assertTrue($a-&gt;parent(0)-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;parent数値指定1段階の戻り値が違います。&#39;</span>);
<a name="l00310"></a>00310                 $this-&gt;assertTrue($b-&gt;parent(0)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;parent数値指定2段階の戻り値が違います。&#39;</span>);
<a name="l00311"></a>00311                 $this-&gt;assertTrue($a-&gt;parent(3)-&gt;isEmpty(), <span class="stringliteral">&#39;parent数値指定、存在しない値の戻り値が違います。&#39;</span>);
<a name="l00312"></a>00312                 
<a name="l00313"></a>00313                 <span class="comment">// オブジェクトセレクタのテスト</span>
<a name="l00314"></a>00314                 $this-&gt;assertTrue($a-&gt;parent($this-&gt;obj)-&gt;pick() === $this-&gt;obj-&gt;pick(), <span class="stringliteral">&#39;parentオブジェクト指定の戻り値が違います。&#39;</span>);
<a name="l00315"></a>00315                 $this-&gt;assertTrue($b-&gt;parent($c)-&gt;isEmpty(), <span class="stringliteral">&#39;parentオブジェクト指定、存在しない値の戻り値が違います。&#39;</span>);
<a name="l00316"></a>00316                 
<a name="l00317"></a>00317                 <span class="comment">// 戻り値の確認。selector型の試験自体はまた今度。</span>
<a name="l00318"></a>00318                 $this-&gt;assertTrue(get_class($a-&gt;parent(<span class="stringliteral">&#39;test&#39;</span>)) === <span class="stringliteral">&#39;YuTori&#39;</span>, <span class="stringliteral">&#39;parentの戻り値がYuToriではありません。&#39;</span>);
<a name="l00319"></a>00319                 $this-&gt;assertTrue($a-&gt;parent(<span class="stringliteral">&#39;test&#39;</span>)-&gt;getType() === <span class="stringliteral">&#39;null&#39;</span>, <span class="stringliteral">&#39;parentの戻り値のgetTypeが間違っています。&#39;</span>);
<a name="l00320"></a>00320         }
<a name="l00321"></a>00321 
<a name="l00322"></a>00322         <span class="comment">// callの動作確認。</span>
<a name="l00323"></a><a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#aa39c0337e5e649f86330829af4efbd3b">00323</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/db7/class_testof_yu_tori_factory.html#aa39c0337e5e649f86330829af4efbd3b">TestofCall</a>() {
<a name="l00324"></a>00324                 <span class="comment">// nullのcallはnull返すだけ。</span>
<a name="l00325"></a>00325                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;Test&#39;</span>, null);
<a name="l00326"></a>00326                 $this-&gt;assertIdentical($obj-&gt;call(), null, <span class="stringliteral">&#39;null型のcallの戻り値が正しくありません。&#39;</span>);
<a name="l00327"></a>00327 
<a name="l00328"></a>00328                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;Test&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>);
<a name="l00329"></a>00329                 $this-&gt;assertIdentical($obj-&gt;call(), <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;scalar型のcallの戻り値が正しくありません。&#39;</span>);
<a name="l00330"></a>00330 
<a name="l00331"></a>00331                 $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;Test&#39;</span>, <span class="stringliteral">&#39;myFunc&#39;</span>, <a class="code" href="../../d0/dfd/class_yu_tori.html#a0a2c1f3ba4b81c0938122ff4e88764f8">YuTori::TYPE_CALLABLE</a>);
<a name="l00332"></a>00332                 $this-&gt;assertIdentical($obj-&gt;call(), <span class="stringliteral">&#39;func!&#39;</span>, <span class="stringliteral">&#39;function型のcallの戻り値が正しくありません。&#39;</span>);
<a name="l00333"></a>00333                 $this-&gt;assertIdentical($obj-&gt;call(<span class="stringliteral">&#39;arg&#39;</span>), <span class="stringliteral">&#39;arg&#39;</span>, <span class="stringliteral">&#39;function型のcallに引数が渡されていません。&#39;</span>);
<a name="l00334"></a>00334 
<a name="l00335"></a>00335         }
<a name="l00336"></a>00336 
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 
<a name="l00339"></a>00339 
<a name="l00340"></a>00340 <span class="comment">// object型の専用試験</span>
<a name="l00341"></a><a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html">00341</a> <span class="keyword">class </span><a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html">TestofYuTori_TypeofObject</a> <span class="keyword">extends</span> UnitTestCase {
<a name="l00342"></a>00342         <span class="comment">// インスタンス化</span>
<a name="l00343"></a><a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html#a095c5d389db211932136b53f25f39685">00343</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html#a095c5d389db211932136b53f25f39685">__construct</a> () {
<a name="l00344"></a>00344                 $this-&gt;ins = <span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>();
<a name="l00345"></a>00345                 $this-&gt;obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, $this-&gt;ins);
<a name="l00346"></a>00346         }
<a name="l00347"></a>00347         
<a name="l00348"></a>00348         <span class="comment">// get、setの動作確認</span>
<a name="l00349"></a><a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html#a05a8a3b5812cb7362f9ffc818593a479">00349</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html#a05a8a3b5812cb7362f9ffc818593a479">TestofInstance</a>() {
<a name="l00350"></a>00350                 $this-&gt;ins-&gt;flgReset ();
<a name="l00351"></a>00351                 
<a name="l00352"></a>00352                 $this-&gt;assertTrue($this-&gt;obj-&gt;get()-&gt;beforeGet, <span class="stringliteral">&#39;_beforeGetメソッドが動作していません。&#39;</span>);
<a name="l00353"></a>00353                 $this-&gt;assertTrue($this-&gt;obj-&gt;get()-&gt;afterGet, <span class="stringliteral">&#39;_afterGetメソッドが動作していません。&#39;</span>);
<a name="l00354"></a>00354                 $this-&gt;assertFalse($this-&gt;obj-&gt;get()-&gt;beforeSet, <span class="stringliteral">&#39;_beforeSetメソッドが動作しています。&#39;</span>);
<a name="l00355"></a>00355                 $this-&gt;assertFalse($this-&gt;obj-&gt;get()-&gt;afterSet, <span class="stringliteral">&#39;_afterSetメソッドが動作しています。&#39;</span>);
<a name="l00356"></a>00356                 $this-&gt;ins-&gt;flgReset ();
<a name="l00357"></a>00357                 
<a name="l00358"></a>00358                 $newObj = <span class="keyword">new</span> stdClass ();
<a name="l00359"></a>00359                 $this-&gt;assertTrue($this-&gt;obj-&gt;set ($newObj) === $this-&gt;obj, <span class="stringliteral">&#39;setの戻り値が自分自身ではありません。&#39;</span>);
<a name="l00360"></a>00360                 $this-&gt;assertIdentical($this-&gt;obj-&gt;get(), $newObj, <span class="stringliteral">&#39;setに同一の型（オブジェクト）を指定しても値が変更されませんでした。&#39;</span>);
<a name="l00361"></a>00361                 
<a name="l00362"></a>00362                 $this-&gt;obj-&gt;set ($this-&gt;ins);
<a name="l00363"></a>00363                 
<a name="l00364"></a>00364                 $this-&gt;assertTrue($this-&gt;obj-&gt;get()-&gt;beforeGet, <span class="stringliteral">&#39;_beforeGetメソッドが動作していません。&#39;</span>);
<a name="l00365"></a>00365                 $this-&gt;assertTrue($this-&gt;obj-&gt;get()-&gt;afterGet, <span class="stringliteral">&#39;_afterGetメソッドが動作していません。&#39;</span>);
<a name="l00366"></a>00366                 $this-&gt;assertTrue($this-&gt;obj-&gt;get()-&gt;beforeSet, <span class="stringliteral">&#39;_beforeSetメソッドが動作していません。&#39;</span>);
<a name="l00367"></a>00367                 $this-&gt;assertTrue($this-&gt;obj-&gt;get()-&gt;afterSet, <span class="stringliteral">&#39;_afterSetメソッドが動作していません。&#39;</span>);
<a name="l00368"></a>00368                 $this-&gt;ins-&gt;flgReset ();
<a name="l00369"></a>00369                 
<a name="l00370"></a>00370                 <span class="comment">// 紛らわしいので戻す</span>
<a name="l00371"></a>00371                 $this-&gt;obj-&gt;set($this-&gt;ins);
<a name="l00372"></a>00372         }
<a name="l00373"></a>00373         
<a name="l00374"></a>00374         <span class="comment">// callの動作確認。</span>
<a name="l00375"></a><a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html#aa39c0337e5e649f86330829af4efbd3b">00375</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/dbf/class_testof_yu_tori___typeof_object.html#aa39c0337e5e649f86330829af4efbd3b">TestofCall</a>() {
<a name="l00376"></a>00376                 $this-&gt;obj-&gt;set($this-&gt;ins);
<a name="l00377"></a>00377                 $this-&gt;assertIdentical($this-&gt;obj-&gt;call(), <span class="stringliteral">&#39;call!&#39;</span>, <span class="stringliteral">&#39;callの戻り値がcallメソッドの戻り値ではありません。&#39;</span>);
<a name="l00378"></a>00378                 $this-&gt;ins-&gt;flgReset ();
<a name="l00379"></a>00379                 $this-&gt;assertIdentical($this-&gt;obj-&gt;call(<span class="stringliteral">&#39;called&#39;</span>), <span class="stringliteral">&#39;call!&#39;</span>, <span class="stringliteral">&#39;callの戻り値がcallメソッドの戻り値ではありません。&#39;</span>);
<a name="l00380"></a>00380                 $this-&gt;assertIdentical($this-&gt;ins-&gt;callRes, <span class="stringliteral">&#39;called&#39;</span>, <span class="stringliteral">&#39;callに引数が渡されていません。&#39;</span>);
<a name="l00381"></a>00381         }
<a name="l00382"></a>00382 }
<a name="l00383"></a>00383 
<a name="l00384"></a>00384 <span class="comment">// array型の専用試験</span>
<a name="l00385"></a><a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html">00385</a> <span class="keyword">class </span><a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html">TestofYuTori_TypeofArray</a> <span class="keyword">extends</span> UnitTestCase {
<a name="l00386"></a>00386         <span class="comment">// インスタンス化</span>
<a name="l00387"></a><a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html#a095c5d389db211932136b53f25f39685">00387</a>         <span class="keyword">public</span> function <a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html#a095c5d389db211932136b53f25f39685">__construct</a> () {
<a name="l00388"></a>00388                 $this-&gt;arr = array(<span class="charliteral">&#39;a&#39;</span>, <span class="charliteral">&#39;b&#39;</span>, <span class="stringliteral">&#39;asc&#39;</span>=&gt;<span class="charliteral">&#39;c&#39;</span>, <span class="stringliteral">&#39;obj&#39;</span>=&gt;<span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>());
<a name="l00389"></a>00389                 $this-&gt;obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>(<span class="stringliteral">&#39;test&#39;</span>, $this-&gt;arr);
<a name="l00390"></a>00390         }
<a name="l00391"></a>00391         
<a name="l00392"></a>00392         <span class="comment">// childの動作確認。set時に全配下が生成されているか。</span>
<a name="l00393"></a><a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html#ac745cdeeaef1f219759fda3115213bb6">00393</a>         <span class="keyword">public</span> function <a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html#ac745cdeeaef1f219759fda3115213bb6">TestofChild</a>() {
<a name="l00394"></a>00394                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="charliteral">&#39;0&#39;</span>)-&gt;get() === <span class="charliteral">&#39;a&#39;</span>, <span class="stringliteral">&#39;array型の配下に値がありません。(0)&#39;</span>);
<a name="l00395"></a>00395                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="charliteral">&#39;1&#39;</span>)-&gt;get() === <span class="charliteral">&#39;b&#39;</span>, <span class="stringliteral">&#39;array型の配下に値がありません。(0)&#39;</span>);
<a name="l00396"></a>00396                 $this-&gt;assertTrue($this-&gt;obj-&gt;child(<span class="stringliteral">&#39;asc&#39;</span>)-&gt;get() === <span class="charliteral">&#39;c&#39;</span>, <span class="stringliteral">&#39;array型の配下に値がありません。(0)&#39;</span>);
<a name="l00397"></a>00397         }
<a name="l00398"></a>00398         
<a name="l00399"></a>00399         <span class="comment">// callの動作確認。</span>
<a name="l00400"></a>00400         <span class="comment">// callはchildren全部にcallをかけ、その結果を配列として返す。</span>
<a name="l00401"></a><a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html#aa39c0337e5e649f86330829af4efbd3b">00401</a>         <span class="keyword">public</span> function <a class="code" href="../../db/d6e/class_testof_yu_tori___typeof_array.html#aa39c0337e5e649f86330829af4efbd3b">TestofCall</a>() {
<a name="l00402"></a>00402                 $this-&gt;assertIdentical($this-&gt;obj-&gt;call(), array(<span class="charliteral">&#39;a&#39;</span>, <span class="charliteral">&#39;b&#39;</span>, <span class="stringliteral">&#39;asc&#39;</span>=&gt;<span class="charliteral">&#39;c&#39;</span>, <span class="stringliteral">&#39;obj&#39;</span>=&gt;<span class="stringliteral">&#39;call!&#39;</span>), <span class="stringliteral">&#39;callの戻り値が正しくありません。&#39;</span>);
<a name="l00403"></a>00403         }
<a name="l00404"></a>00404 }
<a name="l00405"></a>00405 
<a name="l00406"></a>00406 <span class="comment">// 基幹関数Yのテスト</span>
<a name="l00407"></a><a class="code" href="../../dd/ddb/class_testof_y.html">00407</a> <span class="keyword">class </span><a class="code" href="../../dd/ddb/class_testof_y.html">TestofY</a> <span class="keyword">extends</span> UnitTestCase {
<a name="l00408"></a><a class="code" href="../../dd/ddb/class_testof_y.html#a05a8a3b5812cb7362f9ffc818593a479">00408</a>         <span class="keyword">public</span> function <a class="code" href="../../dd/ddb/class_testof_y.html#a05a8a3b5812cb7362f9ffc818593a479">TestofInstance</a>() {
<a name="l00409"></a>00409                 <span class="comment">// 二度呼び出して同じものかどうか</span>
<a name="l00410"></a>00410                 $a = <a class="code" href="../../d7/d1c/class_y.html">Y</a>();
<a name="l00411"></a>00411                 $b = <a class="code" href="../../d7/d1c/class_y.html">Y</a>();
<a name="l00412"></a>00412                 $this-&gt;assertTrue($a === $b, <span class="stringliteral">&#39;Y()を二度呼び出した場合、別の参照になっています。&#39;</span>);
<a name="l00413"></a>00413                 $this-&gt;assertIdentical($a-&gt;getName(), <span class="stringliteral">&#39;Root&#39;</span>, <span class="stringliteral">&#39;getNypeが間違っています。&#39;</span>);
<a name="l00414"></a>00414                 $this-&gt;assertIdentical($a-&gt;getType(), <span class="stringliteral">&#39;null&#39;</span>, <span class="stringliteral">&#39;getTypeが間違っています。&#39;</span>);
<a name="l00415"></a>00415         }
<a name="l00416"></a>00416         
<a name="l00417"></a>00417         <span class="comment">// addした後childセレクタを引数とできるか</span>
<a name="l00418"></a><a class="code" href="../../dd/ddb/class_testof_y.html#ac745cdeeaef1f219759fda3115213bb6">00418</a>         <span class="keyword">public</span> function <a class="code" href="../../dd/ddb/class_testof_y.html#ac745cdeeaef1f219759fda3115213bb6">TestofChild</a>() {
<a name="l00419"></a>00419                 <span class="comment">// 形を作っておく。値は区別がつく程度に適当。</span>
<a name="l00420"></a>00420                 $a = <a class="code" href="../../d7/d1c/class_y.html">Y</a>()-&gt;add (<span class="charliteral">&#39;a&#39;</span>, <span class="stringliteral">&#39;value_a&#39;</span>);
<a name="l00421"></a>00421                 $b = $a-&gt;add (<span class="charliteral">&#39;b&#39;</span>, <span class="stringliteral">&#39;value_b&#39;</span>);
<a name="l00422"></a>00422                 $c = $b-&gt;add (<span class="charliteral">&#39;c&#39;</span>, <span class="stringliteral">&#39;value_c&#39;</span>);
<a name="l00423"></a>00423                 $a2 = <a class="code" href="../../d7/d1c/class_y.html">Y</a>()-&gt;add (<span class="stringliteral">&#39;a2&#39;</span>, <span class="stringliteral">&#39;value_a2&#39;</span>);
<a name="l00424"></a>00424                 $b2 = $a2-&gt;add (<span class="stringliteral">&#39;b2&#39;</span>, <span class="stringliteral">&#39;value_b2&#39;</span>);
<a name="l00425"></a>00425                 $b22 = $a2-&gt;add (<span class="stringliteral">&#39;b22&#39;</span>, <span class="stringliteral">&#39;value_b22&#39;</span>);
<a name="l00426"></a>00426                 $c2 = $b2-&gt;add (<span class="stringliteral">&#39;c2&#39;</span>, <span class="stringliteral">&#39;value_c2&#39;</span>);
<a name="l00427"></a>00427                 $c22 = $b2-&gt;add (<span class="stringliteral">&#39;c22&#39;</span>, <span class="stringliteral">&#39;value_c22&#39;</span>);
<a name="l00428"></a>00428                 $a3 = <a class="code" href="../../d7/d1c/class_y.html">Y</a>()-&gt;add (<span class="stringliteral">&#39;a3&#39;</span>, <span class="stringliteral">&#39;value_a3&#39;</span>);
<a name="l00429"></a>00429                 $b3 = $a3-&gt;add (<span class="stringliteral">&#39;b3&#39;</span>, <span class="stringliteral">&#39;value_b3&#39;</span>);
<a name="l00430"></a>00430                 $c3 = $b3-&gt;add (<span class="stringliteral">&#39;c3&#39;</span>, <span class="stringliteral">&#39;value_c3&#39;</span>);
<a name="l00431"></a>00431                 
<a name="l00432"></a>00432                 <span class="comment">// 文字列セレクタのテスト</span>
<a name="l00433"></a>00433                 <span class="comment">// 1段階</span>
<a name="l00434"></a>00434                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="charliteral">&#39;a&#39;</span>)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;child文字列指定1段階(a)の戻り値が違います。&#39;</span>);
<a name="l00435"></a>00435                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39; a2 &#39;</span>)-&gt;pick() === $a2-&gt;pick(), <span class="stringliteral">&#39;child文字列指定1段階(a2)の戻り値が違います。&#39;</span>);
<a name="l00436"></a>00436                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a3.&#39;</span>)-&gt;pick() === $a3-&gt;pick(), <span class="stringliteral">&#39;child文字列指定1段階(a3.)の戻り値が違います。&#39;</span>);
<a name="l00437"></a>00437                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a4&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定1段階(a4、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00438"></a>00438                 
<a name="l00439"></a>00439                 <span class="comment">// 2段階</span>
<a name="l00440"></a>00440                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a.b&#39;</span>)-&gt;pick() === $b-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a.b)の戻り値が違います。&#39;</span>);
<a name="l00441"></a>00441                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a2 . b2&#39;</span>)-&gt;pick() === $b2-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a2 . b2)の戻り値が違います。&#39;</span>);
<a name="l00442"></a>00442                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a3 . b3 .&#39;</span>)-&gt;pick() === $b3-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a3 . b3 .)の戻り値が違います。&#39;</span>);
<a name="l00443"></a>00443                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="charliteral">&#39;b&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定1段階(b、2段階目に存在している)の戻り値が違います。&#39;</span>);
<a name="l00444"></a>00444                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a.b2&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定2段階(a.b2、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00445"></a>00445                 
<a name="l00446"></a>00446                 <span class="comment">// 3段階</span>
<a name="l00447"></a>00447                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a.b.c&#39;</span>)-&gt;pick() === $c-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a.b.c)の戻り値が違います。&#39;</span>);
<a name="l00448"></a>00448                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a2 . b2 . c2&#39;</span>)-&gt;pick() === $c2-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a2 . b2 . c2)の戻り値が違います。&#39;</span>);
<a name="l00449"></a>00449                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a3 . b3 . c3 .&#39;</span>)-&gt;pick() === $c3-&gt;pick(), <span class="stringliteral">&#39;child文字列指定2段階(a3 . b3 . c3 .)の戻り値が違います。&#39;</span>);
<a name="l00450"></a>00450                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;b.c&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定2段階(b.c、3段階目に存在している)の戻り値が違います。&#39;</span>);
<a name="l00451"></a>00451                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a.b.c2&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child文字列指定3段階(a.b.c2、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00452"></a>00452                 
<a name="l00453"></a>00453                 <span class="comment">// 数値セレクタのテスト</span>
<a name="l00454"></a>00454                 <span class="comment">// 1段階</span>
<a name="l00455"></a>00455                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(0)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;child数値指定1段階(0)の戻り値が違います。&#39;</span>);
<a name="l00456"></a>00456                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(1)-&gt;pick() === $a2-&gt;pick(), <span class="stringliteral">&#39;child数値指定1段階(1)の戻り値が違います。&#39;</span>);
<a name="l00457"></a>00457                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(2)-&gt;pick() === $a3-&gt;pick(), <span class="stringliteral">&#39;child数値指定1段階(2)の戻り値が違います。&#39;</span>);
<a name="l00458"></a>00458                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(3)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定1段階(3、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00459"></a>00459                 
<a name="l00460"></a>00460                 <span class="comment">// 2段階</span>
<a name="l00461"></a>00461                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;0.0&#39;</span>)-&gt;pick() === $b-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(0.0)の戻り値が違います。&#39;</span>);
<a name="l00462"></a>00462                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;1.0&#39;</span>)-&gt;pick() === $b2-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(1.0)の戻り値が違います。&#39;</span>);
<a name="l00463"></a>00463                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;1.1.&#39;</span>)-&gt;pick() === $b22-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(1.1.)の戻り値が違います。&#39;</span>);
<a name="l00464"></a>00464                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;0.1&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定2段階(0.1、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00465"></a>00465                 
<a name="l00466"></a>00466                 <span class="comment">// 3段階</span>
<a name="l00467"></a>00467                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;0.0.0&#39;</span>)-&gt;pick() === $c-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(0.0.0)の戻り値が違います。&#39;</span>);
<a name="l00468"></a>00468                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;1.0.1&#39;</span>)-&gt;pick() === $c22-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(1.0.1)の戻り値が違います。&#39;</span>);
<a name="l00469"></a>00469                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;2.0.0.&#39;</span>)-&gt;pick() === $c3-&gt;pick(), <span class="stringliteral">&#39;child数値指定2段階(2.0.0.)の戻り値が違います。&#39;</span>);
<a name="l00470"></a>00470                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;1.1.2&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定3段階(1.1.2、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00471"></a>00471                 
<a name="l00472"></a>00472                 <span class="comment">// 文字・数値混在</span>
<a name="l00473"></a>00473                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a2.1&#39;</span>)-&gt;pick() === $b22-&gt;pick(), <span class="stringliteral">&#39;child混在指定(a2.1)の戻り値が違います。&#39;</span>);
<a name="l00474"></a>00474                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a.0.&#39;</span>)-&gt;pick() === $b-&gt;pick(), <span class="stringliteral">&#39;child混在指定(a.0.)の戻り値が違います。&#39;</span>);
<a name="l00475"></a>00475                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="stringliteral">&#39;a.1&#39;</span>)-&gt;isEmpty(), <span class="stringliteral">&#39;child数値指定1段階(a.1、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00476"></a>00476                 
<a name="l00477"></a>00477                 <span class="comment">// オブジェクトセレクタのテスト</span>
<a name="l00478"></a>00478                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>($a)-&gt;pick() === $a-&gt;pick(), <span class="stringliteral">&#39;childオブジェクト指定($a)の戻り値が違います。&#39;</span>);
<a name="l00479"></a>00479                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>($b)-&gt;isEmpty(), <span class="stringliteral">&#39;childオブジェクト指定($b、存在しない)の戻り値が違います。&#39;</span>);
<a name="l00480"></a>00480                 
<a name="l00481"></a>00481                 <span class="comment">// 戻り値の確認。</span>
<a name="l00482"></a>00482                 $this-&gt;assertTrue(<a class="code" href="../../d7/d1c/class_y.html">Y</a>(<span class="charliteral">&#39;a&#39;</span>)-&gt;getType() === <span class="stringliteral">&#39;scalar&#39;</span>, <span class="stringliteral">&#39;childの戻り値のgetTypeが間違っています。&#39;</span>);
<a name="l00483"></a>00483         }
<a name="l00484"></a>00484 }
<a name="l00485"></a>00485 
<a name="l00486"></a>00486 <span class="comment">// 比較系メソッドの試験</span>
<a name="l00487"></a><a class="code" href="../../da/d84/class_testof_yu_tori_compression.html">00487</a> <span class="keyword">class </span><a class="code" href="../../da/d84/class_testof_yu_tori_compression.html">TestofYuToriCompression</a> <span class="keyword">extends</span> UnitTestCase {
<a name="l00488"></a><a class="code" href="../../da/d84/class_testof_yu_tori_compression.html#a095c5d389db211932136b53f25f39685">00488</a>         <span class="keyword">public</span> function <a class="code" href="../../da/d84/class_testof_yu_tori_compression.html#a095c5d389db211932136b53f25f39685">__construct</a> () {
<a name="l00489"></a>00489                 $this-&gt;arrObj = array(
<a name="l00490"></a>00490                         <span class="stringliteral">&#39;Null&#39;</span>=&gt;null,
<a name="l00491"></a>00491                         <span class="stringliteral">&#39;Scalar&#39;</span>=&gt;<span class="stringliteral">&#39;Hello World!&#39;</span>,
<a name="l00492"></a>00492                         <span class="stringliteral">&#39;Array&#39;</span>=&gt;array(<span class="charliteral">&#39;a&#39;</span>, <span class="charliteral">&#39;b&#39;</span>, <span class="charliteral">&#39;c&#39;</span>),
<a name="l00493"></a>00493                         <span class="stringliteral">&#39;Object&#39;</span>=&gt;<span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>(),
<a name="l00494"></a>00494                 );
<a name="l00495"></a>00495         }
<a name="l00496"></a>00496 
<a name="l00497"></a>00497         <span class="comment">// isEmptyの試験</span>
<a name="l00498"></a><a class="code" href="../../da/d84/class_testof_yu_tori_compression.html#a8de6156c5c667d41d7cffb43253770b1">00498</a>         <span class="keyword">public</span> function <a class="code" href="../../da/d84/class_testof_yu_tori_compression.html#a8de6156c5c667d41d7cffb43253770b1">TestofisEmpty</a>() {
<a name="l00499"></a>00499                 $objEmp = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;&#39;</span>, null, <span class="stringliteral">&#39;Empty&#39;</span>);
<a name="l00500"></a>00500                 $this-&gt;assertTrue($objEmp-&gt;isEmpty(), <span class="stringliteral">&#39;空オブジェクトに対してisEmptyがtrueを返していません。&#39;</span>);
<a name="l00501"></a>00501                 
<a name="l00502"></a>00502                 <span class="keywordflow">foreach</span> ($this-&gt;arrObj as $Key=&gt;$Val) {
<a name="l00503"></a>00503                         $obj = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a>($Key, $Val);
<a name="l00504"></a>00504                         $this-&gt;assertFalse($obj-&gt;isEmpty(), $Key.<span class="stringliteral">&#39;型の時、isEmptyがfalseを返していません。&#39;</span>);
<a name="l00505"></a>00505                 }
<a name="l00506"></a>00506         }
<a name="l00507"></a>00507         
<a name="l00508"></a>00508         <span class="comment">// eq、seqの試験</span>
<a name="l00509"></a>00509         <span class="comment">// このへんからエラー文の法則変更…。</span>
<a name="l00510"></a><a class="code" href="../../da/d84/class_testof_yu_tori_compression.html#a4a55eeaab6843c540fb0c2f0227dee4f">00510</a>         <span class="keyword">public</span> function <a class="code" href="../../da/d84/class_testof_yu_tori_compression.html#a4a55eeaab6843c540fb0c2f0227dee4f">TestofEq</a>() {
<a name="l00511"></a>00511                 $objEmp = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;&#39;</span>, null, <span class="stringliteral">&#39;Empty&#39;</span>);
<a name="l00512"></a>00512                 $this-&gt;assertTrue($objEmp-&gt;eq(null), <span class="stringliteral">&#39;空オブジェクトとnullのeq比較&#39;</span>);
<a name="l00513"></a>00513                 $this-&gt;assertTrue($objEmp-&gt;seq(null), <span class="stringliteral">&#39;空オブジェクトとnullのseq比較&#39;</span>);
<a name="l00514"></a>00514                 $this-&gt;assertFalse($objEmp-&gt;eq(<span class="stringliteral">&#39;test&#39;</span>), <span class="stringliteral">&#39;空オブジェクトと文字列のeq比較&#39;</span>);
<a name="l00515"></a>00515                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;test&#39;</span>), <span class="stringliteral">&#39;空オブジェクトと文字列のseq比較&#39;</span>);
<a name="l00516"></a>00516                 $this-&gt;assertTrue($objEmp-&gt;eq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;空オブジェクトと空文字列のeq比較&#39;</span>);
<a name="l00517"></a>00517                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;空オブジェクトと空文字列のseq比較&#39;</span>);
<a name="l00518"></a>00518                 $this-&gt;assertTrue($objEmp-&gt;eq(0), <span class="stringliteral">&#39;空オブジェクトと0のeq比較&#39;</span>);
<a name="l00519"></a>00519                 $this-&gt;assertFalse($objEmp-&gt;seq(0), <span class="stringliteral">&#39;空オブジェクトと0のseq比較&#39;</span>);
<a name="l00520"></a>00520 
<a name="l00521"></a>00521                 $objEmp = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, null);
<a name="l00522"></a>00522                 $this-&gt;assertTrue($objEmp-&gt;eq(null), <span class="stringliteral">&#39;null型とnullのeq比較&#39;</span>);
<a name="l00523"></a>00523                 $this-&gt;assertTrue($objEmp-&gt;seq(null), <span class="stringliteral">&#39;null型とnullのseq比較&#39;</span>);
<a name="l00524"></a>00524                 $this-&gt;assertFalse($objEmp-&gt;eq(<span class="stringliteral">&#39;test&#39;</span>), <span class="stringliteral">&#39;null型と文字列のeq比較&#39;</span>);
<a name="l00525"></a>00525                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;test&#39;</span>), <span class="stringliteral">&#39;null型と文字列のseq比較&#39;</span>);
<a name="l00526"></a>00526                 $this-&gt;assertTrue($objEmp-&gt;eq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;null型と空文字列のeq比較&#39;</span>);
<a name="l00527"></a>00527                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;null型と空文字列のseq比較&#39;</span>);
<a name="l00528"></a>00528                 $this-&gt;assertTrue($objEmp-&gt;eq(0), <span class="stringliteral">&#39;null型と0のeq比較&#39;</span>);
<a name="l00529"></a>00529                 $this-&gt;assertFalse($objEmp-&gt;seq(0), <span class="stringliteral">&#39;null型と0のseq比較&#39;</span>);
<a name="l00530"></a>00530 
<a name="l00531"></a>00531                 $objEmp = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>);
<a name="l00532"></a>00532                 $this-&gt;assertFalse($objEmp-&gt;eq(null), <span class="stringliteral">&#39;scalar型とnullのeq比較&#39;</span>);
<a name="l00533"></a>00533                 $this-&gt;assertFalse($objEmp-&gt;eq(null), <span class="stringliteral">&#39;scalar型とnullのseq比較&#39;</span>);
<a name="l00534"></a>00534                 $this-&gt;assertTrue($objEmp-&gt;eq(<span class="stringliteral">&#39;test&#39;</span>), <span class="stringliteral">&#39;scalar型と文字列のeq比較&#39;</span>);
<a name="l00535"></a>00535                 $this-&gt;assertTrue($objEmp-&gt;seq(<span class="stringliteral">&#39;test&#39;</span>), <span class="stringliteral">&#39;scalar型と文字列のseq比較&#39;</span>);
<a name="l00536"></a>00536                 $this-&gt;assertFalse($objEmp-&gt;eq(<span class="stringliteral">&#39;test2&#39;</span>), <span class="stringliteral">&#39;scalar型と異なる文字列のeq比較&#39;</span>);
<a name="l00537"></a>00537                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;test2&#39;</span>), <span class="stringliteral">&#39;scalar型と異なる文字列のseq比較&#39;</span>);
<a name="l00538"></a>00538                 $this-&gt;assertFalse($objEmp-&gt;eq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;scalar型と空文字列のeq比較&#39;</span>);
<a name="l00539"></a>00539                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;scalar型と空文字列のseq比較&#39;</span>);
<a name="l00540"></a>00540                 $this-&gt;assertTrue($objEmp-&gt;eq(0), <span class="stringliteral">&#39;scalar型と0のeq比較&#39;</span>); <span class="comment">// &#39;test&#39; == 0 はtrueになる。</span>
<a name="l00541"></a>00541                 $this-&gt;assertFalse($objEmp-&gt;seq(0), <span class="stringliteral">&#39;scalar型と0のseq比較&#39;</span>);
<a name="l00542"></a>00542 
<a name="l00543"></a>00543                 $objEmp = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, <span class="charliteral">&#39;0&#39;</span>);
<a name="l00544"></a>00544                 $this-&gt;assertFalse($objEmp-&gt;eq(null), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型とnullのeq比較&#39;</span>);
<a name="l00545"></a>00545                 $this-&gt;assertFalse($objEmp-&gt;eq(null), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型とnullのseq比較&#39;</span>);
<a name="l00546"></a>00546                 $this-&gt;assertTrue($objEmp-&gt;eq(<span class="charliteral">&#39;0&#39;</span>), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と文字列のeq比較&#39;</span>);
<a name="l00547"></a>00547                 $this-&gt;assertTrue($objEmp-&gt;seq(<span class="charliteral">&#39;0&#39;</span>), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と文字列のseq比較&#39;</span>);
<a name="l00548"></a>00548                 $this-&gt;assertFalse($objEmp-&gt;eq(<span class="stringliteral">&#39;test2&#39;</span>), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と異なる文字列のeq比較&#39;</span>);
<a name="l00549"></a>00549                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;test2&#39;</span>), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と異なる文字列のseq比較&#39;</span>);
<a name="l00550"></a>00550                 $this-&gt;assertFalse($objEmp-&gt;eq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と空文字列のeq比較&#39;</span>);
<a name="l00551"></a>00551                 $this-&gt;assertFalse($objEmp-&gt;seq(<span class="stringliteral">&#39;&#39;</span>), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と空文字列のseq比較&#39;</span>);
<a name="l00552"></a>00552                 $this-&gt;assertTrue($objEmp-&gt;eq(0), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と0のeq比較&#39;</span>);
<a name="l00553"></a>00553                 $this-&gt;assertFalse($objEmp-&gt;seq(0), <span class="stringliteral">&#39;文字列のゼロを入れたscalar型と0のseq比較&#39;</span>);
<a name="l00554"></a>00554 
<a name="l00555"></a>00555                 $obj = <span class="keyword">new</span> stdClass();
<a name="l00556"></a>00556                 $objCmp1 = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, $obj);
<a name="l00557"></a>00557                 $objCmp2 = <span class="keyword">new</span> stdClass();
<a name="l00558"></a>00558                 $objCmp3 = <span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>();
<a name="l00559"></a>00559                 $this-&gt;assertTrue($objCmp1-&gt;eq($obj), <span class="stringliteral">&#39;同じ参照のオブジェクトとeq&#39;</span>);
<a name="l00560"></a>00560                 $this-&gt;assertTrue($objCmp1-&gt;seq($obj), <span class="stringliteral">&#39;同じ参照のオブジェクトとseq&#39;</span>);
<a name="l00561"></a>00561                 $this-&gt;assertTrue($objCmp1-&gt;eq($objCmp2), <span class="stringliteral">&#39;同じ内容を持ったオブジェクトとeq&#39;</span>);
<a name="l00562"></a>00562                 $this-&gt;assertFalse($objCmp1-&gt;seq($objCmp2), <span class="stringliteral">&#39;同じ内容を持ったオブジェクトとseq&#39;</span>);
<a name="l00563"></a>00563                 $this-&gt;assertFalse($objCmp1-&gt;eq($objCmp3), <span class="stringliteral">&#39;別のオブジェクトとseq&#39;</span>);
<a name="l00564"></a>00564                 $this-&gt;assertFalse($objCmp1-&gt;seq($objCmp3), <span class="stringliteral">&#39;別のオブジェクトとseq&#39;</span>);
<a name="l00565"></a>00565 
<a name="l00566"></a>00566                 $objCmp1 = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, <span class="keyword">new</span> <a class="code" href="../../d7/d1e/classmy_cls.html">myCls</a>());
<a name="l00567"></a>00567                 $this-&gt;assertTrue($objCmp1-&gt;eq(<span class="stringliteral">&#39;call!&#39;</span>), <span class="stringliteral">&#39;callを持ったオブジェクトとeq&#39;</span>);
<a name="l00568"></a>00568                 $this-&gt;assertTrue($objCmp1-&gt;seq(<span class="stringliteral">&#39;call!&#39;</span>), <span class="stringliteral">&#39;callを持ったオブジェクトとseq&#39;</span>);
<a name="l00569"></a>00569                 $this-&gt;assertFalse($objCmp1-&gt;eq(<span class="stringliteral">&#39;call&#39;</span>), <span class="stringliteral">&#39;callを持ったオブジェクトと違う値をeq&#39;</span>);
<a name="l00570"></a>00570                 $this-&gt;assertFalse($objCmp1-&gt;seq(<span class="stringliteral">&#39;call&#39;</span>), <span class="stringliteral">&#39;callを持ったオブジェクトと違う値をseq&#39;</span>);
<a name="l00571"></a>00571 
<a name="l00572"></a>00572                 $objCmp1 = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>);
<a name="l00573"></a>00573                 $objCmp2 = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test1&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>);
<a name="l00574"></a>00574                 $objCmp3 = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test2&#39;</span>, <span class="stringliteral">&#39;test2&#39;</span>);
<a name="l00575"></a>00575                 $this-&gt;assertTrue($objCmp1-&gt;eq($objCmp2), <span class="stringliteral">&#39;同じ内容を持った別のYuToriとeq&#39;</span>);
<a name="l00576"></a>00576                 $this-&gt;assertTrue($objCmp1-&gt;seq($objCmp2), <span class="stringliteral">&#39;同じ内容を持った別のYuToriとseq&#39;</span>);
<a name="l00577"></a>00577                 $this-&gt;assertFalse($objCmp1-&gt;eq($objCmp3), <span class="stringliteral">&#39;違う内容を持った別のYuToriとeq&#39;</span>);
<a name="l00578"></a>00578                 $this-&gt;assertFalse($objCmp1-&gt;seq($objCmp3), <span class="stringliteral">&#39;違う内容を持った別のYuToriとseq&#39;</span>);
<a name="l00579"></a>00579         }
<a name="l00580"></a>00580 }
<a name="l00581"></a>00581 
<a name="l00582"></a>00582 <span class="comment">// 出力系メソッドの試験</span>
<a name="l00583"></a><a class="code" href="../../dc/dbc/class_testof_yu_tori_output.html">00583</a> <span class="keyword">class </span><a class="code" href="../../dc/dbc/class_testof_yu_tori_output.html">TestofYuToriOutput</a> <span class="keyword">extends</span> UnitTestCase {
<a name="l00584"></a>00584         <span class="comment">// putの試験</span>
<a name="l00585"></a><a class="code" href="../../dc/dbc/class_testof_yu_tori_output.html#a265c712647d4c379e8a9e3f3cabf2093">00585</a>         <span class="keyword">public</span> function <a class="code" href="../../dc/dbc/class_testof_yu_tori_output.html#a265c712647d4c379e8a9e3f3cabf2093">TestofPut</a>() {
<a name="l00586"></a>00586                 $objStr = <a class="code" href="../../d0/dfd/class_yu_tori.html#abc5f41aad67f5f93d46b4bebbfd2ec3a">YuTori::factory</a> (<span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;test&#39;</span>);
<a name="l00587"></a>00587 
<a name="l00588"></a>00588                 ob_start ();
<a name="l00589"></a>00589                 $objStr-&gt;put(); $res = ob_get_contents(); ob_end_clean();
<a name="l00590"></a>00590                 $this-&gt;assertIdentical($res, <span class="stringliteral">&#39;test&#39;</span>, <span class="stringliteral">&#39;無指定のput&#39;</span>);
<a name="l00591"></a>00591                 ob_start ();
<a name="l00592"></a>00592                 $objStr-&gt;set (null);
<a name="l00593"></a>00593                 $objStr-&gt;put(<span class="stringliteral">&#39;NULL&#39;</span>); $res = ob_get_contents(); ob_end_clean();
<a name="l00594"></a>00594                 $this-&gt;assertIdentical($res, <span class="stringliteral">&#39;NULL&#39;</span>, <span class="stringliteral">&#39;null時のput&#39;</span>);
<a name="l00595"></a>00595                 ob_start ();
<a name="l00596"></a>00596                 $objStr-&gt;set (5);
<a name="l00597"></a>00597                 $objStr-&gt;put(null, <span class="stringliteral">&#39;%03d&#39;</span>); $res = ob_get_contents(); ob_end_clean();
<a name="l00598"></a>00598                 $this-&gt;assertIdentical($res, <span class="stringliteral">&#39;005&#39;</span>, <span class="stringliteral">&#39;フォーマット指定のput&#39;</span>);
<a name="l00599"></a>00599         }
<a name="l00600"></a>00600 }
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全て</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>データ構造</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>関数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>変数</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>YuTori Classに対してMon May 21 2012 00:22:16に生成されました。&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
